package eu.irreality.dai.ui.wrapper;

import java.awt.Color;
import java.awt.Graphics;

import eu.irreality.dai.ui.cell.DisplayableObject;
import eu.irreality.dai.world.level.Level;

/*
 Created 26/08/2007 18:46:52
 */

/**
 * Interface for a roguelike game's display. Can be implemented for ASCII native
 * displays, ASCII simulated displays, tile displays, etc.
 */
public interface Display
{

    /**
     * Sets the number of rows and columns in the display. Each (row,col) cell
     * in the matrix can display an object or character.
     * 
     * @param rows
     *            number of rows in the display
     * @param cols
     *            number of columns in the display
     */
    public void setSize(int rows, int cols);

    public void setPixelSize(int pixelRows, int pixelCols);

    /**
     * Gets the number of rows in the display.
     * 
     * @return number of rows in the display
     */
    public int getRows();

    /**
     * Gets the number of columns in the display.
     * 
     * @return number of columns in the display
     */
    public int getCols();

    /**
     * The "camera point" is the point that we would like to have in the center
     * of the screen if only a part of the display can actually be shown (i.e.
     * the map is larger than the window)
     * 
     * @param rows
     * @param cols
     */
    public void setCameraPoint(int rows, int cols);

    /**
     * Clear the whole display.
     */
    public void clear();

    /**
     * Clear a cell in the display.
     * 
     * @param row
     *            row index to clear (0=first, 1=second, ... , -1=last)
     * @param col
     */
    public void clearCell(int row, int col);

    /**
     * Add an object to a cell in the display.
     */
    public void addContent(int row, int col, DisplayableObject dObj);

    /**
     * Add text. Text is absolute (not affected by "zoom".
     */
    public void addText(int row, int col, String text);

    /**
     * Refresh the display.
     */
    public void refresh(Graphics graphics);

    /**
     * Sets a level.
     * 
     * @param level
     */
    public void setLevel(Level level);

    public void setText(String text, Color color);

    public void appendText(String text, Color color);

    public void setData(String key, String message, Color color);

}
